import React from 'react';
import { NavBar, Button, Toast } from 'antd-mobile';
import { useNavigate } from 'react-router-dom';
import { logout } from '../utils/auth';
import './Pending.css';

function Pending() {
    const navigate = useNavigate();

    const handleLogout = () => {
        logout();
        navigate('/login');
        Toast.show({ content: '已退出登录' });
    };

    return (
        <div className="pending-container">
            <NavBar 
                backArrow={false} 
                className="pending-navbar"
                right={
                    <Button 
                        fill="none" 
                        color="white" 
                        size="small"
                        onClick={handleLogout}
                    >
                        退出登录
                    </Button>
                }
            >
                等待审核
            </NavBar>

            <div className="pending-content">
                <div className="pending-icon">
                    <div className="pending-animation">
                        <div className="pending-circle"></div>
                        <div className="pending-circle"></div>
                        <div className="pending-circle"></div>
                    </div>
                </div>

                <div className="pending-text">
                    <h2>审核中</h2>
                    <p>您的注册申请正在审核中，请耐心等待</p>
                    <p className="pending-tip">
                        审核通过后，您就可以开始接单了
                    </p>
                </div>

                <div className="pending-actions">
                    <Button
                        block
                        color="primary"
                        size="large"
                        onClick={() => navigate('/login')}
                    >
                        重新登录
                    </Button>
                </div>

                <div className="pending-info">
                    <h3>审核说明</h3>
                    <ul>
                        <li>我们会在1-3个工作日内完成审核</li>
                        <li>审核通过后，您将收到短信通知</li>
                        <li>如有疑问，请联系客服：400-123-4567</li>
                    </ul>
                </div>
            </div>
        </div>
    );
}

export default Pending; 